package com.atguigu.eduservice.controller;


import com.atguigu.common.R;
import com.atguigu.eduservice.entity.EduTeacher;
import com.atguigu.eduservice.entity.teachervo.QueryTeacher;
import com.atguigu.eduservice.service.EduTeacherService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-04-06
 */
@Api(description="登录")
@RestController  //jackson
@RequestMapping("/eduservice")
@CrossOrigin

public class EduLoginInfoController {

    //1 模拟登录，后面改成权限管理
    @PostMapping("user/login")
    public R login() {
        //{"code":20000,"data":{"token":"admin"}}
        return R.ok().data("token","admin");
    }

    //2 info
    @GetMapping("user/info")
    public R info() {
        //{"code":20000,"data":{"roles":["admin"],"name":"admin","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif"}}
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
}

